import requests from "./axios";

//用户登录
export const reqLogin = (data)=>requests({url:'/user/login',data,method:'post'})
//管理员登录
export const reqAdminLogin = (data)=>requests({url:'/employee/login',data,method:'post'})
//验证码
export const reqCode = ()=>requests({url:'pin',method:'get'})
//注册
export const reqRegister = (data)=>requests({url:'/user/save',data,method:'post'})
//新增管理员  {"name":"sick","username":"sick","phone":"17585225442","sex":"男"}
export const reqAddAdmin = (data)=>requests({url:'/employee',data,method:'post'})
//员工分页  page  pageSize
export const reqUserPage = (params)=>requests({url:'/employee/page',method:'get',params})
//修改员工信息和状态（两个接口传不同参数）
export const reqAdminUpdate = (data)=>requests({url:'/employee',data,method:'put'})
//医院新增   {"name":"花溪医院","location":"花溪"}
export const reqAddHospital = (data)=>requests({url:'/hospital',data,method:'post'})
//医院修改  {"id":"1573561116527718401","name":"花溪医院666","location":"花溪"}
export const reqUpdateHospital = (data)=>requests({url:'/hospital',data,method:'put'})
//医院删除  id
export const reqDeleteHospital = (params)=>requests({url:'/hospital',method:'delete',params})
//获取医院信息
export const reqHospital = ()=>requests({url:'/hospital/list',method:'get'})
//获取轮椅信息(分页)
export const reqWheelchair = (params)=>requests({url:'/wheelchair/page',method:'get',params})
//删除员工
export const reqDeleteUser = (params)=>requests({url:'/employee',method:'delete',params})
//删除轮椅信息
export const reqDeleteWheelchair = (params)=>requests({url:'/wheelchair',method:'delete',params})
//通过id获取用户信息
let adminId = localStorage.getItem("ADMINTOKEN")
export const reqAdminIdInfo = ()=>requests({url:`/employee/${adminId}`,method:'get'})
let userId = localStorage.getItem("USERTOKEN")
// export const reqUserIdInfo = ()=>requests({url:`/user/${userId}`,method:'get'})
//条件查询医院信息
// export const reqConditionHospital = (params)=>requests({url:'/hospital/name',method:'get',params})
//管理员登出
export const reqAdminLogout = ()=>requests({url:'/employee/logout',method:'post'})
//用户登出
export const reqUserLogout = ()=>requests({url:'/user/logout',method:'post'})
//新增轮椅
export const reqAddWheelchair = (data)=>requests({url:'/wheelchair',data,method:'post'})
//修改轮椅信息
export const reqUpdateWheelchair = (data)=>requests({url:'/wheelchair',data,method:'put'})
//订单分页（后台）
export const reqOrder = (params)=>requests({url:'/order/page',method:'get',params})
//通过名字获取医院信息
export const reqNameHospital = (params)=>requests({url:'/hospital/name',method:'get',params})
//通过医院名字获取轮椅信息
export const reqNameWheelchair = (params)=>requests({url:'/wheelchair/name',method:'get',params})
//下单
export const reqAddOrder = (data)=>requests({url:'/order',data,method:'post'})
//全部订单展示
export const reqUserOrderInfo = (params)=>requests({url:`/order/list`,method:'get',params})
//归还轮椅改变状态
export const reqReturnOrderStatus = (data)=>requests({url:'/order',data,method:'put'})
//归还轮椅算钱
export const reqReturnOrder = (params)=>requests({url:`/order`,method:'get',params})
